package com.igeek.service;

import com.igeek.dao.EmpDao;
import com.igeek.entity.Employee;
import com.igeek.rowmapper.EmpMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EmpService {

    @Resource
    private EmpDao empDao;

    /**
     * 根据部门编号查询员工
     * @return
     */
    public List<Employee> findByDepId(int depId){
        return empDao.findByDepId(depId);
    }

    /**
     * 根据主键查询员工
     * @param empId
     * @return
     */
    public Employee findById(int empId){
        return empDao.findById(empId);
    }

    /**
     * 修改员工薪资
     * @param emp
     */
    public void update(Employee emp){
        empDao.update(emp);
    }
}
